package com.biscuit.page.basicservice.remote.api;

import com.biscuit.common.base.BaseModelResponse;
import com.biscuit.common.base.BaseResponse;
import com.biscuit.common.base.BaseResponseVoid;
import com.biscuit.page.basicservice.api.IPaymentRemote;
import com.biscuit.page.basicservice.service.PaymentService;
import com.biscuit.page.basicservice.utils.BaseResponseUtil;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;

/**
 * @author biscuit
 * @create 2024年08月05日 14:43
 */
@RestController
public class PaymentRemoteImpl implements IPaymentRemote {

    @Resource
    private PaymentService service;

    @Override
    public void alipay(BigDecimal amount, HttpServletResponse httpResponse) {
        this.service.alipay(amount, httpResponse);
    }

    @Override
    public BaseResponse<BaseResponseVoid> alipayNotify(HttpServletRequest request) throws Exception {
        this.service.alipayNotify(request);
        return BaseResponseUtil.success();
    }
}
